import request from '@/utils/request'

// const domain = 'https://hhmstudy.tk/api'
// 学生列表
export function getStudentList(params) {
  return request({
    url: `/student/list`,
    method: 'get',
    params
  })
}

// 学生详情
export function getStudentDetail(params) {
  return request({
    url: `/student/query/${params.id}`,
    method: 'get',
    params: {}
  })
}

// 新增学生
export function addStudent(params) {
  return request({
    url: `/student/add`,
    method: 'post',
    data: params
  })
}

// 导出教师
export function exportTeacher(params) {
  return request({
    url: `/teacher/exportTeacher`,
    method: 'get',
    params
  })
}

// 教师列表
export function getTeacher(params) {
  return request({
    url: `/teacher/list`,
    method: 'get',
    params
  })
}

// 新增教师
export function addTeacher(params) {
  return request({
    url: `/teacher/add`,
    method: 'post',
    data: params
  })
}

// 教师详情
export function getTeacherDetail(params) {
  return request({
    url: `/teacher/query/${params.id}`,
    method: 'get',
    params: {}
  })
}

// 乡校列表 分页
export function getXSchool(params) {
  return request({
    url: `/school/pageSubSchool`,
    method: 'get',
    params
  })
}

// 乡校列表 不分页
export function getXSchoolList(params) {
  return request({
    url: `/school/listAllSubSchool`,
    method: 'get',
    params
  })
}

// 新增乡校
export function addXSchool(params) {
  return request({
    url: `/school/saveSubSchool`,
    method: 'post',
    data: params
  })
}

// 删除乡校
export function deleteXSchool(params) {
  return request({
    url: `/school/deleteSubSchool/${params.id}`,
    method: 'post',
    data: {}
  })
}

// 乡镇列表 不分页
export function getAreaList(params) {
  return request({
    url: `/area/listAll`,
    method: 'get',
    params
  })
}

// 全部学期列表
export function getAllTerm(params) {
  return request({
    url: `/school/term/listAll`,
    method: 'get',
    params
  })
}

// 学期列表
export function getTerm(params) {
  return request({
    url: `/school/term/list`,
    method: 'get',
    params
  })
}

// 学期详情
export function getTermDetail(params) {
  return request({
    url: `/school/term/query/${params.id}`,
    method: 'get',
    params: {}
  })
}

// 新增学期
export function addTerm(params) {
  return request({
    url: `/school/term/add`,
    method: 'post',
    data: params
  })
}

// 开始学期
export function startTerm(params) {
  return request({
    url: `/school/term/start/${params.id}`,
    method: 'post',
    data: params
  })
}

// 结束学期
export function endTerm(params) {
  return request({
    url: `/school/term/stop/${params.id}`,
    method: 'post',
    data: params
  })
}
